package com.example.znjt0617xmy;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;

import java.util.Timer;
import java.util.TimerTask;

public class GuideActivity extends AppCompatActivity {
    static boolean flag=true;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_guide);
        Timer timer=new Timer();
        TimerTask timerTask = new TimerTask() {
            @Override
            public void run() {
                Intent intent=new Intent(getApplicationContext(),MainActivity.class);
                startActivity(intent);
                finish();
            }
        };
        if (flag){
            timer.schedule(timerTask,3000);
            flag=false;
        }else {
            timer.schedule(timerTask,0);
        }

    }
}